package com.geeguo.ebuilder.core.common.dictionary;

import java.util.Arrays;
import java.util.List;

public enum BooleanEnum implements IDictionary {

    /**
     * 是
     */
    True(1, "是"),
    /**
     * 否
     */
    False(2, "否");

    private int    value;
    private String label;

    BooleanEnum(int value, String label) {
        this.value = value;
        this.label = label;
    }

    @Override
    public int getValue() {
        return value;
    }
    
    @Override
    public String getLabel() {
        return label;
    }
    
    public String getStringValue() {
        return String.valueOf(value);
    }

    public static List<BooleanEnum> getEnumValues() {
        return Arrays.asList(values());
    }
    
    public static BooleanEnum parse(int value) {
        for (BooleanEnum item : BooleanEnum.values()) {
            if (value == item.getValue()) {
                return item;
            }
        }
        return null;
    }
}